using System;
using System.Collections.Generic;
using UnityEngine;

namespace Features
{

    [CreateAssetMenu(fileName = "Puncture", menuName = "Features/穿透", order = 3)]
    public class Puncture : Feature
    {
        public override void CancleEffect(FeatureEventArgs args)
        {

        }

        public override void ExecuteEffect(FeatureEventArgs args)
        {
            if (args.pawn.campIsSelf)
            {
                GridManager.instance.GetGridNode(1, 1).Pawn.BeHit(args.ExcessDamage, args.Attacker);

                SpriteTextManager.NewEffectText("穿透", args.pawn.transform.position.x, args.pawn.transform.position.y, Color.red);
            }
            else
            {
                GridManager.instance.GetGridNode(6, 1).Pawn.BeHit(args.ExcessDamage, args.Attacker);
                SpriteTextManager.NewEffectText("穿透", args.pawn.transform.position.x, args.pawn.transform.position.y, Color.red);
            }
        }

        public override string GetDescription()
        {
            return GetTriggerText() + "对敌方英雄造成过量伤害";
        }
    }
}